
package com.catsic.zcjc.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.catsic.base.BaseServiceImpl;
import com.catsic.base.exception.CatsicException;
import com.catsic.core.exception.CatsicExceptionCode;
import com.catsic.zcjc.constants.ZcjcConstants;
import com.catsic.zcjc.dao.CityDao;
import com.catsic.zcjc.entity.City;
import com.catsic.zcjc.service.CityService;


@Service("cityService")
public class CityServiceImpl extends BaseServiceImpl<City, Long> implements CityService{
	
	/**
	 * CityDao:城市Dao
	 */
	@Autowired
	private CityDao cityDao;
	
	

	@Override
	public City findById(Long id){
		City City = getById(id);
		if(null == City){
			throw new CatsicException(CatsicExceptionCode.实体不存在, ZcjcConstants.CITY);
		}
		return City;
	}
	

	
	@Override
	public List<City> findByProvince(Long provinceId) {
		return cityDao.findByProvince(provinceId);
	}
	
	
}
